<%@page import="Model.ProductUser.ProductUserView"%>
<%@page import="Model.Banner.BannerList"%>
<%@page import="RssEasy.DAL.Pagination"%>
<%@page import="RssEasy.DAL.Pagination"%>
<%@page import="Servlet.purchase.list"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    ProductUserView pro = new ProductUserView(pageContext);
    ProductUserView pr = new ProductUserView(pageContext);
    String k = request.getParameter("keywords");
    pro.request();
    pro.pagesize = 12;
    pro.select().where("ptstate=2 and name like '%" +k + "%'").get_page_desc("id");
    pr.select("count(*) as num").where("ptstate=2 and name like '%" + k + "%'").get_first_rows();
    int numb = (int) Math.ceil(Integer.parseInt(pr.get("num")) / 12.0);
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>企企通-产品搜索结果</title>
        <link href="/css/reset.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/head.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/footer.css" rel="stylesheet" type="text/css"/>
        <link href="/css/product_result.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <%@include file="/inc/head.jsp" %>
        <!--结果-->
        <p>当前位置：<span>产品搜索列表</span></p>
        <form method="post">
            筛选条件：
            <input type="text" name="keywords" placeholder="请输入产品名称进行查询" value="<%=k%>"/>
            <button type="button">查询</button>
        </form>
        <h1>结果列表<span id="num">共有<%pr.write("num");%>条</span></h1>
        <div id="result">
            <% while (pro.for_in_rows()) {%>
            <div lei="<%pro.write("id");%>">
                <img src="/upfile/<%pro.write("pt");%>">
                <p><%pro.write("name");%></p>
                <h3><em><%pro.write("corpname");%></em>
                    <%
                        int s=1;
                        s = Integer.parseInt(pro.get("honesty"));
                        for(int i=0;i<s;i++){
                    %>
                    <i></i>
                    <%
                        }
                    %>
                </h3>
            </div>
           <%}%>
        </div>
        <!--分页-->
        <div class="page" id="paging">
            <a href= "javascript:void(0);" id="first" onclick ="first()" sort="">首页</a>
            <a href= "javascript:void(0);" id="previous" onclick ="previous()" sort="">上一页</a>
            <a><b>1</b>/<b><%=numb%></b></a>
            <a href= "javascript:void(0);" id="next" onclick ="next()" sort="">下一页</a>
            <a href= "javascript:void(0);" id="last" onclick ="last()" sort="">尾页</a>
            <a>跳转</a>
            <input type="text" name="jump" value=""/>
            <a href= "javascript:void(0);" id="jump" onclick ="jump()" sort="">确定</a>
        </div>
        <!--产品详情-->
        <div id="background">
            <div id="details"></div>
        </div>
        <%@include file="/inc/footer.jsp"%>
        <%@include file="/inc/js_all.html"%>
        <script src="/js/product_result.js" type="text/javascript"></script>
    </body>
</html>
